package org.test.stream.test.shidianbai;/*

author：ngr
date：{2023/9/8}
*/

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

public class Poker {
    //花色
    private static final List<String> colors=List.of("♠", "♥", "♣", "♦");
    //点数
    private static final List<String> points= List.of("2", "A", "K", "Q", "J", "10", "9", "8", "7", "6", "5", "4", "3");

    //扑克牌对象
    private List<Card> pokers ;

    public Poker(){
        pokers=new ArrayList<>();

        for (int i = 0; i <colors.size() ; i++) {
            for (int j = 0; j <points.size() ; j++) {
                Double orderTood=points.get(j).equals("A")?1:points.get(j).equals("J")|| points.get(j).equals("Q")||points.get(j).equals("K")?0.5:Integer.valueOf(points.get(j));
                pokers.add(new Card(colors.get(i),points.get(j),orderTood));
            }
        }

    }
    public List<Card> getPokers(){
        Collections.shuffle(pokers);
        return pokers;
    }
}
